<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>email</title>
		<script type="text/javascript">
			function vf() {
				var email = prompt("请输入您的邮箱", "xxx@sohu.com");
				if((email.indexOf("@") == -1) || email.indexOf(".") == -1) {
					alert("邮箱格式错误");
				} else {
					alert("验证通过");
				}
			}
		</script>
	</head>

	<body>
		<input type="button" value="验证" onclick="vf();" />
	</body>

</html>